package Deque;

import java.io.File;
import java.util.*;

/**
 * @Auther: MFM
 * @Date: 2021/7/27 - 07 - 27 - 11:16
 * @version: 1.0
 */

public class MapDemo {

    public static void main(String[] args) throws Exception {
        Scanner scanner = new Scanner(new File("./day727/src/Deque/Student.txt"));

        Map<String,Map<String,List<String>>> map = new HashMap<>();

        while (scanner.hasNextLine()) {
            String s = scanner.nextLine();

            String[] strings = s.split("，");

            String grade = strings[3];
            String major = strings[2];

            if (map.get(grade)==null){
                Map<String,List<String>> map1 = new HashMap<>();
                map.put(grade,map1);
            }

            if (map.get(grade).get(major)==null){
                List<String> list = new ArrayList<>();
                list.add(s);
                map.get(grade).put(major,list);
            }else {
                map.get(grade).get(major).add(s);
            }

        }
        scanner.close();

        System.out.println(map.get("2011"));


    }
}
